* Iris Arbogast (irisarbogast@gmail.com)
* 5/22/2022
* Regressions with data from CMS

 
 
**************** Table 2: Impact of policy changes on child Medicaid and CHIP Enrollment
use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2009, 2010,2011, 2012, 2013, 2021, 2022)
est clear

* benchmark
eststo: xtreg mchiprate Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

* By policy type
eststo: xtreg mchiprate automatic_drop str_and_freq new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

* No Controls
eststo: xtreg mchiprate Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs i.date i.st, vce(cluster st)

* No 2020
use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2009, 2010,2011, 2012, 2013, 2021, 2022, 2020)

eststo: xtreg mchiprate Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

* Churn
use Data/Clean/churn_policy.dta, clear

eststo: xtreg churn Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.year i.st, vce(cluster st)


esttab using "Output/Tables/Table2.csv", replace  ///
  b(4) se(4) label scalar("r2_w  Within R2") ///
 star(* 0.05 ** 0.01) ///
 drop(*.st *.date *.year) ///
  mtitle("Benchmark" "By policy type" "No Controls" "Without 2020" "Churn")
 
 
 
**************** Table 3: Impact of lagged policy changes on child Medicaid and CHIP Enrollment

use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2009, 2010,2011, 2012, 2013, 2021, 2022)

est clear
eststo: xtreg mchiprate Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)
eststo: xtreg mchiprate L6.cutoffmax L6.Adminburden  L6.Work_Reqs L6.Premlevel_201 L6.new_redetpause L6.MedicaidExpansion L6.GSP L6.ur L6.pov i.date i.st, vce(cluster st)
eststo: xtreg mchiprate L12.cutoffmax L12.Adminburden  L12.Work_Reqs L12.Premlevel_201 L12.new_redetpause L12.MedicaidExpansion L12.GSP L12.ur L12.pov i.date i.st, vce(cluster st)
eststo: xtreg mchiprate L18.cutoffmax L18.Adminburden  L18.Work_Reqs L18.Premlevel_201 L18.new_redetpause L18.MedicaidExpansion L18.GSP L18.ur L18.pov i.date i.st, vce(cluster st)
eststo: xtreg mchiprate L24.cutoffmax L24.Adminburden  L24.Work_Reqs L24.Premlevel_201 L24.new_redetpause L24.MedicaidExpansion L24.GSP L24.ur L24.pov i.date i.st, vce(cluster st)


esttab using "Output/Tables/Table3.csv", replace  ///
 b(4) se(4) label scalar("r2_w  Within R2") ///
 star(* 0.05 ** 0.01) ///
 drop(*.st *.date) ///
  mtitle("Benchmark" "6 mo Lag" "12 mo Lag" "18 mo Lag" "24 mo Lag") ///
  /// rename variables so that they show up in the same row
 rename(L12.cutoffmax cutoffmax L6.cutoffmax cutoffmax L24.cutoffmax cutoffmax L18.cutoffmax cutoffmax ///
 L12.Adminburden Adminburden L6.Adminburden Adminburden L24.Adminburden Adminburden L18.Adminburden Adminburden ///
 L12.Work_Reqs Work_Reqs L6.Work_Reqs Work_Reqs L24.Work_Reqs Work_Reqs L18.Work_Reqs Work_Reqs  ///
 L12.Premlevel_201 Premlevel_201 L6.Premlevel_201 Premlevel_201 L24.Premlevel_201 Premlevel_201 L18.Premlevel_201 Premlevel_201  ///
 L12.new_redetpause new_redetpause L6.new_redetpause new_redetpause L24.new_redetpause new_redetpause L18.new_redetpause new_redetpause  ///
 L12.MedicaidExpansion MedicaidExpansion L6.MedicaidExpansion MedicaidExpansion L24.MedicaidExpansion MedicaidExpansion L18.MedicaidExpansion MedicaidExpansion ///
 L12.GSP GSP L6.GSP GSP L18.GSP GSP  L24.GSP GSP L12.ur ur L6.ur ur L24.ur ur L18.ur ur L12.pov pov L6.pov pov L24.pov pov L18.pov pov) ///
 order(Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP)
 
 
 
 
************** Appendix Table 2: Lagged policy changes on child Medicaid and CHIP enrollment, by policy type
use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 20012, 2010,2011, 2012, 2013, 2021, 2022)


label var str_and_freq `"Increase in Stringency or Frequency of Checks"'

est clear
eststo: xtreg mchiprate Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

eststo: xtreg mchiprate str_and_freq automatic_drop new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

eststo: xtreg mchiprate L6.cutoffmax L6.str_and_freq L6.automatic_drop  L6.Work_Reqs L6.Premlevel_201 L6.new_redetpause L6.MedicaidExpansion L6.GSP L6.ur L6.pov i.date i.st, vce(cluster st)
eststo: xtreg mchiprate L12.cutoffmax L12.str_and_freq L12.automatic_drop  L12.Work_Reqs L12.Premlevel_201 L12.new_redetpause L12.MedicaidExpansion L12.GSP L12.ur L12.pov i.date i.st, vce(cluster st)
eststo: xtreg mchiprate L18.cutoffmax L18.str_and_freq L18.automatic_drop   L18.Work_Reqs L18.Premlevel_201 L18.new_redetpause L18.MedicaidExpansion L18.GSP L18.ur L18.pov i.date i.st, vce(cluster st)
eststo: xtreg mchiprate L24.cutoffmax L24.str_and_freq L24.automatic_drop  L24.Work_Reqs L24.Premlevel_201 L24.new_redetpause L24.MedicaidExpansion L24.GSP L24.ur L24.pov i.date i.st, vce(cluster st)



esttab using "Output/Tables/App_Table2.csv", replace  ///
 b(4) se(4) label scalar("r2_w  Within R2") ///
 star(* 0.05 ** 0.01) ///
 drop(*.st *.date) ///
  mtitle("Benchmark" "Split Variables" "6 mo Lag" "12 mo Lag" "18 mo Lag" "24 mo Lag") ///
  /// rename variables so that they show up in the same row
 rename(L12.cutoffmax cutoffmax L6.cutoffmax cutoffmax L24.cutoffmax cutoffmax L18.cutoffmax cutoffmax ///
 L24.str_and_freq str_and_freq L6.str_and_freq str_and_freq L18.str_and_freq str_and_freq L12.str_and_freq str_and_freq  ///
 L24.freq_check freq_check L6.freq_check freq_check L18.freq_check freq_check L12.freq_check freq_check ///
 L24.automatic_drop automatic_drop L6.automatic_drop automatic_drop L18.automatic_drop automatic_drop L12.automatic_drop automatic_drop ///
 L6.Adminburden Adminburden L24.Adminburden Adminburden L18.Adminburden Adminburden L12.Adminburden Adminburden ///
 L12.Work_Reqs Work_Reqs L6.Work_Reqs Work_Reqs L24.Work_Reqs Work_Reqs L18.Work_Reqs Work_Reqs ///
 L12.Premlevel_201 Premlevel_201 L6.Premlevel_201 Premlevel_201 L24.Premlevel_201 Premlevel_201 L18.Premlevel_201 Premlevel_201 ///
 L12.new_redetpause new_redetpause L6.new_redetpause new_redetpause L24.new_redetpause new_redetpause L18.new_redetpause new_redetpause ///
 L12.MedicaidExpansion MedicaidExpansion L6.MedicaidExpansion MedicaidExpansion L24.MedicaidExpansion MedicaidExpansion L18.MedicaidExpansion MedicaidExpansion ///
 L12.GSP GSP L6.GSP GSP L18.GSP GSP L24.GSP GSP  L12.ur ur L6.ur ur L24.ur ur L18.ur ur  L12.pov pov L6.pov pov L24.pov pov L18.pov pov ) ///
 order(Adminburden automatic_drop str_and_freq new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP) 
 
 
 
 **************** Appendix Table 3: Impact of policy changes on child Medicaid enrollment. Sensitivity checks

use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2009, 2010,2011, 2012, 2013, 2021, 2022)

est clear
* benchmark
eststo: xtreg mchiprate Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

* Regression without Idaho
use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2009, 2010,2011, 2012, 2013, 2021, 2022)
drop if inlist(stusps,"ID")
xtset st date
eststo: xtreg mchiprate Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP  i.date i.st, vce(cluster st)

* Regression without Kansas and Arkansas
use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2009, 2010,2011, 2012, 2013, 2021, 2022)
drop if inlist(stusps,"KS","AR")
xtset st date
eststo: xtreg mchiprate Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP  i.date i.st, vce(cluster st)

* Regression without CA
use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2009, 2010,2011, 2012, 2013, 2021, 2022)
drop if inlist(stusps,"CA")
xtset st date
eststo: xtreg mchiprate Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP  i.date i.st, vce(cluster st)


esttab using "Output/Tables/App_Table3.csv", replace  ///
 b(4) se(4) label scalar("r2_w  Within R2") ///
 star(* 0.05 ** 0.01) ///
 drop(*.st *.date) noomitted ///
 mtitle("Benchmark" "Drop Idaho" "Drop KS and AR" "Drop CA") ///
 order(Adminburden new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP) 
 

 
**************** Appendix Table 4: Impact of policy changes on child Medicaid enrollment using KFF-documented Medicaid policies
use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2007 2009, 2010,2011, 2012, 2013, 2021, 2022)
est clear


* benchmark
eststo: xtreg mchiprate Adminburden  new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

* Add each variable one by one
eststo: xtreg mchiprate Adminburden  waittime_CHIP01 new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

eststo: xtreg mchiprate Adminburden presumpteligCHIP2 new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

eststo: xtreg mchiprate Adminburden  presumpteligMcaid new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

eststo: xtreg mchiprate Adminburden realtimeelig new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

eststo: xtreg mchiprate Adminburden  autorenewal new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

eststo: xtreg mchiprate Adminburden  imm_nowaitMdcd new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

eststo: xtreg mchiprate Adminburden imm_nowaitCHIP2 new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)

eststo: xtreg mchiprate Adminburden  waittime_CHIP01 presumpteligCHIP2 presumpteligMcaid realtimeelig autorenewal imm_nowaitMdcd imm_nowaitCHIP2 new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, vce(cluster st)



esttab using "Output/Tables/App_Table4.csv", replace  ///
  b(4) se(4) label scalar("r2_w  Within R2") ///
 star(* 0.05 ** 0.01) ///
 drop(*.st *.date) ///
  order(Adminburden waittime_CHIP01 presumpteligCHIP2 presumpteligMcaid realtimeelig autorenewal imm_nowaitMdcd imm_nowaitCHIP2 new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP) ///
  mtitle("Benchmark" "CHIP Wait Time" "CHIP Presumptive Eligibility" "Medicaid Presumptive Eligibility" "Real Time Eligibility" "Autorenewal" "No Wait for Immigrants Medicaid" "No Wait for Immigrants CHIP" "Including all KFF Variables") 
 
 
 
 
****************** 
* Figure 2: Event Study of the Effect of New Administrative Burden on Child Medicaid Enrollment 
***************
* read in the overall policy regression data
use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2009, 2010,2011, 2012, 2013, 2021, 2022)
est clear


* with all states
eventdd mchiprate new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, method(ols, cluster(st)) timevar(timesince) ci(rcap) keepbal(st) leads(9) lags(16) graph_op(ytitle("Enrollment Rate") xtitle("Months Before/After Policy Change") graphregion(fcolor(white)) legend(off))

graph export Output/Graphs/fig2a.tif, replace


* 13 leads 17 lags 
eventdd mchiprate new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, method(ols, cluster(st)) timevar(timesince) ci(rcap) keepbal(st) leads(13) lags(17) graph_op(ytitle("Enrollment Rate") xtitle("Months Before/After Policy Change") graphregion(fcolor(white)) legend(off))

graph export Output/Graphs/fig2b.tif, replace

 
* 24 leads 23 lags 
eventdd mchiprate new_redetpause MedicaidExpansion cutoffmax Premlevel_201 Work_Reqs pov ur GSP i.date i.st, method(ols, cluster(st)) timevar(timesince) ci(rcap) keepbal(st) leads(34) lags(23) graph_op(ytitle("Enrollment Rate") xtitle("Months Before/After Policy Change") graphregion(fcolor(white)) legend(off))

graph export Output/Graphs/fig2c.tif, replace



****************** 
* Calculate sample means
***************
use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2009, 2010,2011, 2012, 2013, 2021, 2022)
mean mchiprate

* no 2020
use Data/Clean/Cleaned_Policy_Data.dta, clear
drop if inlist(year,2008, 2009, 2010,2011, 2012, 2013, 2021, 2022, 2020)
mean mchiprate

* 2016
use Data/Clean/Cleaned_Policy_Data.dta, clear
keep if year == 2016
mean mchiprate

* 2014
use Data/Clean/Cleaned_Policy_Data.dta, clear
keep if year == 2014
mean mchiprate
